package net.aaa.hotel.controller;

import net.aaa.hotel.dao.CustomDao;
import net.aaa.hotel.util.LayuiTable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
public class CouSpringController {
    @Autowired
    private CustomDao dao ;

    @RequestMapping("/cou")
    @ResponseBody
    public LayuiTable queryAll(Integer pa,Integer li,String condition ){
        List<Map> map = dao.queryAll(li,pa,condition);
//        System.out.println("condition+++++++"+condition);
        int a = dao.cout(condition);
        LayuiTable ta = new LayuiTable(a, map);
        return ta;
    }

    @RequestMapping("/gai")
    @ResponseBody
    public  int gai(Integer id,Integer status){
        int i =  dao.gai(id,status);
        return i;
    }

}